/**
 * Copyright (c) 2002-2012 旭鸣信息
 * All rights reserved. 
 * File：OrderCouponDaoImpl.java
 * History: Dec 27, 2012: Initially created, liuzhi.
 */
package com.xteam.ecsystem.dao.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.xteam.ecsystem.dao.IOrderCouponDao;
import com.xteam.ecsystem.entities.BaseOrderUsingcoupon;

/**
 * 订单与购物券关联表（使用券、获得券）数据访问实现类
 * @author liuzhi
 *
 */
@Repository
public class OrderCouponDaoImpl extends DDLPrefix implements IOrderCouponDao {
	
	@SuppressWarnings("unchecked")
	@Autowired
	private BaseDaoImpl baseDao;

	public BaseOrderUsingcoupon getBoucInfo(String bouOrder){
		try {
			String hql = SQL_FROM + BaseOrderUsingcoupon.REF + SQL_WHERE + "bouOrder=?";
			Object obj = this.baseDao.findObject(hql, new Object[]{bouOrder});
			if (obj != null) {
				return (BaseOrderUsingcoupon)obj;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return null;
	}
	
	public void deleteOrderUsingcoupon(BaseOrderUsingcoupon bouc){
		try {
			this.baseDao.delete(bouc);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
